import request from '@/utils/request'

export const getRoles = (page, pagesize) => {
  return request.get('/api/sys/role', {
    params: {
      page, pagesize
    }
  })
}

export const delRole = (id) => {
  return request.delete(`/api/sys/role/${id}`)
}

// 封装新增角色接口
export const addRole = (data) => {
  return request.post('/api/sys/role', data)
}

// 封装更新角色接口
export const updateRole = (data) => {
  return request.put(`/api/sys/role${data.id}`)
}
